package com.yonyou.cyxdms.basedata.service.service.configure;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.function.bean.dto.ImportResultDto;
import com.yonyou.cyxdms.basedata.client.domains.vo.PackageCacheVO;
import com.yonyou.cyxdms.basedata.service.dto.CarPriceDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.*;
import com.yonyou.cyxdms.basedata.service.vo.CarPriceImportVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 配置
 *
 * @author renwd
 * @since 2018/12/11
 */
public interface PackageService {

    /**
     * 根据条件查询配置信息
     *
     * @param queryParam
     * @return java.util.List<PackageCacheVO>
     * @author renwd
     * @since 2019/1/9
     */
    List<PackageCacheVO> queryPackageByCondition(Map<String, Object> queryParam);

    /**
     * 根据车型Id查询车辆配置信息
     *
     * @param modelId
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.PackageCacheVO>
     * @author guorp
     * @since 2018/12/13
     */
    public List<PackageCacheVO> getPackageByModelId(Long modelId);

    /**
     * 查询配置信息（pc）
     *
     * @param packageQueryDTO
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author renwd
     * @since 2019/7/10
     */
    IPage<VehicleProductPackageVO> queryVehicleProductPackage(Page page, PackageQueryDTO packageQueryDTO);


    /**
     * qcs根据查询条件返回对应的车型数据
     *
     * @param page
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author renwd
     * @since 2019/7/19
     */
    IPage<VehicleProductPackageVO> queryVehicleProductDcsPackage(Page page, Map<String, Object> queryParam);


    /**
     * 新增配置
     *
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author Tansj
     * @since 2019/11/18
     */
    Integer addPackage(PackageModifyDTO packageModifyDTO);

    /**
     * dcs新增配置
     *
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author Tansj
     * @since 2019/11/18
     */
    Integer addDcsPackage(PackageModifyDTO packageModifyDTO);

    /**
     * 修改配置
     *
     * @param id
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/11/18
     */
    Integer modifyConfig(Long id, PackageModifyDTO packageModifyDTO);

    /**
     * dcs修改配置
     *
     * @param id
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/11/18
     */
    Integer modifyDcsConfig(Long id, PackageModifyDTO packageModifyDTO);

    /**
     * 配置导出excel
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/15
     */
    void exportExcelForPackage(Map<String, Object> queryParam, HttpServletRequest request,
                               HttpServletResponse response);

    /**
     * 配置下拉框查询
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    List<PackageDictVO> queryPackageDict(Map<String, Object> queryParam);

    /**
     * 导入配置
     *
     * @param importFile
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.PackageImportDTO>
     * @author renwd
     * @since 2019/7/22
     */
    List<PackageImportDTO> importPackages(MultipartFile importFile);

    /**
     * 导入销售指导价
     *
     * @author ysj
     * @date 2019/09/20
     * @param importFile
     * @return
     */
    ImportResultDto<CarPriceImportVO> importCarPrice(MultipartFile importFile);

    /**
     * 修改销售指导价
     *
     * @author ysj
     * @date 2019/09/21
     * @param carPriceDTO
     * @return
     */
    Integer editCarPrice(CarPriceDTO carPriceDTO);

    /**
     * @Description: 获取活动车型名称
     * @Param: [appId, brandCode, seriesCode, modelCode, packageCode]
     * @Return: String
     * @Author: lijun
     * @Date: 16:55 2019/9/10
     **/
    String getModelName(String appId,
                        String brandCode,
                        String seriesCode,
                        String modelCode,
                        String packageCode,
                        String colorCode);

    /**
     * @Description: 根据Code获取配置
     * @Param: [modelId, appId, packageCode]
     * @Return: com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO
     * @Author: lijun
     * @Date: 16:06 2019/8/22
     **/
    PackageDictVO getByCode(String appId, Long modelId, String packageCode);

    /**
     * JK获取id与code映射数据
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/9/10
     */
    Map<Long, String> queryPackageMapping(String appId);

    /**
     * 通用-新增/更新配置
     *
     * @author：chenzb
     * @since：2019-10-12
     */
    void addPackageGeneral(List<GeneralPackageDTO> generalPackageDtos);

    /**
     * 获取所有配置
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    List<PackageCacheVO> getAllPackageByAppId(String appId);
    /**
     * 获取所有配置
     *
     * @param:
     * @return:
     * @auther: wangsht
     * @since: 2020/12/15
     */
    void exportExcelForOption(Map<String, Object> queryParam, HttpServletRequest request, HttpServletResponse response);

    /**
     * 品系型查询界面配置下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author Tansj
     * @since 2019/11/18
     */
    List<VehicleProductPackageVO> queryPackageDictAll(String brandsId, String seriesId,String modelsId);

    /**
     * 根据查询条件返回配置
     *
     * @param packageQueryDTO
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author caozx
     * @since 2020/12/8
     */
    List<VehicleProductPackageVO> queryVehicleProductPackage(PackageQueryDTO packageQueryDTO);

}
